package summer.hot100.v1;

public class Solution198 {
    public int rob(int[] nums) {
        int a = 0;
        int b = 0;
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            res = Math.max(res, a + nums[i]);
            a = b;
            b = res;
        }
        return res;
    }
}
